import Vue from 'vue'
import VueRouter from 'vue-router'
import {initMenu} from "../network/menus";

Vue.use(VueRouter)

const routes = [
  // {
  //   path: '/',
  //   redirect: '/login'
  // },
  {
    path: '/',
    name: 'Login',
    component: () => import('../views/Login'),
    hidden: true
  },
  {
    path: '/error',
    name: 'Error',
    component: () => import('../views/Error'),
    hidden: true
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import('../views/Home'),
    children: [
      {
        path: '/test1',
        name: '选项1',
        component: () => import('../views/Test1')
      },
      {
        path: '/test2',
        name: '选项2',
        component: () => import('../views/Test2')
      },
      {
        path: '/chat',
        name: '在线聊天',
        component: () => import('../views/chat/FriendChat')
      },
      {
        path: '/userinfo',
        name: '个人中心',
        component: () => import('../views/AdminInfo')
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
